<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>多群引流</title>
		<!-- elementUI css -->
        <link rel="stylesheet" href="/unpkg/lib-master/theme-chalk/index.css"> 
		<link rel="stylesheet" href="/css/public.css">
		<style type="text/css">
			html {
				background-color: #E5E5E5;
			}

			.card {
				width: 95%;
				background-color: #FFFFFF;
				padding-bottom: 1px;
				border-radius: 10px;
				margin: 10px auto 0;
			}

			.title {
				height: 120px;
				background-color: #EAF5FF;
				padding-top: 1px;
				border-top-left-radius: 10px;
				border-top-right-radius: 10px;
			}

			.title-box {
				display: flex;
				flex-direction: column;
				align-items: center;
				margin-top: 20px;
			}

			.title img {
				width: 50px;
				height: 50px;
				border-radius: 50%;
			}

			.tags {
				height: 140px;
				display: flex;
				flex-wrap: wrap;
				justify-content: space-between;
				align-items: center;
				padding: 20px 10px;
				box-sizing: border-box;
			}

			.tags-item {
				width: 80px;
				height: 30px;
				border-radius: 15px;
				background-color: #F3F6F9;
				text-align: center;
				line-height: 30px;
			}

			.active {
				background-color: #E3F2FF;
				border: 1px solid #B4DCFF;
			}

			.EWM {
				display: flex;
				justify-content: center;
			}

			.EWM img {
				width: 250px;
				height: 250px;
			}

			.explain1 {
				text-align: center;
				font-size: 12px;
				color: #C3C3C3;
				margin: 20px 0;
			}

			.explain2 {
				color: #969696;
				font-size: 14px;
				text-align: center;
				padding: 0 30px;
				margin-bottom: 20px;
			}
		</style>

	</head>

	<body>
		<div id="app">
			<div class="card">
				<div class="title">
					<div class="title-box">
						<img src="{$logo}"
							alt="">
						<strong>{$corpName}</strong>
					</div>
				</div>
				<div class="tags">
					{foreach $multigroup->data as $k => $data}
						<span class="tags-item {if $k=0}active{/if}" data-id="{$data['id']}">{$data['selfname']}</span>
					{/foreach}
				</div>
				<div class="EWM">
					<img id="qrimg" src="{$mh->getQrcode($multigroup->data[0]['id'],$showQrType)}"
						alt="">
				</div>
				<div class="explain1">
					<span>{$multigroup->introducer}</span>
				</div>
				<div class="explain2">
					<span id="desc">{$multigroup->data[0]['desc']}</span>
				</div>
			</div>
		</div>
		<!-- vue js -->
		<script src="/cdn/jquery.js"></script>
		<script src="/layui/layui.js"></script>
		<script src="/cusmanage/js/layui.all.js"></script>
		<script src="/js/ajax.js"></script>
		<script type="text/javascript">
			var showQrType = {$showQrType};
			var mg_id = {$multigroup->id};

			$(".tags-item").on('click',function(){
				// console.log($(this).data('id'));
				let id =	$(this).data('id');
				myAjaxPost(false, true, 'getQrcode.html?id='+id+'&t='+showQrType+'&mg_id='+mg_id, { id:id}, function (resp) {
					console.log(resp);
					if (resp.status == 'success') {
						$("#qrimg").attr('src',resp.data.img);
						$("#desc").html(resp.data.desc);
					}
				});
			})

		</script>
	</body>

</html>
